package net.tv90.volunteerserveradmin.model.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.tv90.volunteerserveradmin.model.domain.User;

import java.io.Serializable;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class UserVO implements Serializable {
    private Long id;
    private String username;
    private String phoneNumber;
    private String email;
    private Integer role;
    private Long roleId;

    public UserVO(User user) {
        this.id = user.getId();
        this.username = user.getUsername();
        this.phoneNumber = user.getPhoneNumber();
        this.email = user.getEmail();
        this.role = user.getRole();
        this.roleId = user.getRoleId();
    }
}
